﻿using System.ComponentModel;
using System.Diagnostics;

namespace uTILLIty.Rave.Service
{
	[RunInstaller(true)]
	public class RavePerformanceCounterInstaller : PerformanceCounterInstaller
	{
		public RavePerformanceCounterInstaller()
		{
			CategoryName = "DirCreator";
			CategoryType = PerformanceCounterCategoryType.MultiInstance;

			Counters.Add(new CounterCreationData
			{
				CounterName = "JobStart",
				CounterType = PerformanceCounterType.RateOfCountsPerSecond32,
				CounterHelp = "Occurs when a job has been detected in the hotfolder and is about to be processed"
			});
			Counters.Add(new CounterCreationData
			{
				CounterName = "JobsRunning",
				CounterType = PerformanceCounterType.NumberOfItems32,
				CounterHelp = "The amount of jobs currently being processed"
			});
			Counters.Add(new CounterCreationData
			{
				CounterName = "JobEnd",
				CounterType = PerformanceCounterType.RateOfCountsPerSecond32,
				CounterHelp = "Occurs when a job has been finished (regardless of outcome)"
			});
			Counters.Add(new CounterCreationData
			{
				CounterName = "Error",
				CounterType = PerformanceCounterType.RateOfCountsPerSecond32,
				CounterHelp = "Occurs when a job could not be successfully processed"
			});
		}
	}
}